<?php
namespace App\Http\Controllers\API;
use App\Models\NumberCompany;
use App\Models\PhoneNumber;

class FreengController {

    public function phoneToCompany(\Illuminate\Http\Request $request){
        $model = NumberCompany::query()->firstOrCreate(['number'=>$request->number]);
        if($model->status=='成功'&&$model->company){
            return ['code'=>'200','data'=>$model];
        }else{
            if($model->status=='失败'){
                return ['code'=>'404','message'=>'无信息'];
            }
            return ['code'=>'202','message'=>'查询中,请稍后再次查询'];
        }
    }
}
